#include "BasePlugin.h"

class BasePluginPrivate{
public:
    QString mPluginName;
    QString mDescription;
    QVector<PluginType> mTypes;
    friend class BasePlugin;
};

BasePlugin::BasePlugin(QString name, QString description, QObject *parent):
   _p(new BasePluginPrivate)
{
    _p->mPluginName = name;
    _p->mDescription = description;
}

BasePlugin::~BasePlugin()
{

}

QString BasePlugin::GetName()
{
    return _p->mPluginName;
}

QString BasePlugin::GetDescription()
{
    return _p->mDescription;
}

QVector<PluginType> &BasePlugin::GetType()
{
    return _p->mTypes;
}

bool BasePlugin::AddType(PluginType type)
{
    _p->mTypes.push_back(type);
    return true;
}

bool BasePlugin::HasType(PluginType type)
{
    return _p->mTypes.contains(type);
}

void* BasePlugin::HandleEvent(Event event, void *pData, BasePlugin *pSender)
{
    return nullptr;
}

